/*
 * @Descripttion: 需求文档
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-08-05 15:20:25
 * @LastEditors: GW
 * @LastEditTime: 2021-09-04 13:51:40
 */

import { axios } from '../../utils/request'

const api = {
    formUrl: '/sdt/form/getFormList', //获取表列表
    filedUrl: '/sdt/form/getFieldList',//获取字段列表
    filedSaveUrl: '/sdt/form/saveField',//保存字段

    saveUrl: '/sdt/file/save',//保存
    getContentUrl: '/sdt/file/pageList',//获取列表

    saveTextUrl: '/rd/tools/save',//保存 数据文件，数据流，数据存储，处理逻辑与流程

    deleteTextUrl: '/rd/tools/delete',//删除
    listTextUrl: '/rd/tools/getList',//获取列表

    initUrl: '/sdt/form/importData',//初始化表名

}


//获取内容数据
export function getContentApi (data) {
    return axios({
        url: api.getContentUrl,
        method: "get",
        params: data
    })
}

//初始化表名
export function initDataFormApi (data) {
    return axios({
        url: api.initUrl,
        method: "post",
        params: data
    })
}

//保存字段
export function filedSaveApi (data) {
    return axios({
        url: api.filedSaveUrl,
        method: "post",
        data: data
    })
}
//保存 数据文件，数据流，数据存储，处理逻辑与流程
export function saveTextApi (data) {
    return axios({
        url: api.saveTextUrl,
        method: "post",
        data: data
    })
}
export function listTextApi (data) {
    return axios({
        url: api.listTextUrl,
        method: "get",
        params: data
    })
}

export function deleteTextApi (data) {
    return axios({
        url: api.deleteTextUrl,
        method: "DELETE",
        params: data
    })
}









//获取字段列表
export function fieldApi (data) {
    return axios({
        url: api.filedUrl,
        method: "get",
        params: data
    })
}
//保存字段
export function saveApi (data) {
    return axios({
        url: api.saveUrl,
        method: "post",
        data: data
    })
}
//删除字段
export function deleteField (data) {
    return axios({
        url: '/sdt/form/deleteField',
        method: "DELETE",
        params: data
    })
}






//获取表列表
export function formApi (data) {
    return axios({
        url: api.formUrl,
        method: "get",
        params: data
    })
}
//保存表
export function saveForm (data) {
    return axios({
        url: '/sdt/form/saveForm',
        method: "post",
        data: data
    })
}
//删除表
export function deleteForm (data) {
    return axios({
        url: '/sdt/form/deleteForm',
        method: "DELETE",
        params: data
    })
}




//通过项目获取表列表
export function getListByProject (data) {
    return axios({
        url: '/sdt/form/getListByProjectId',
        method: "get",
        params: data,
        timeout: 500000,
    })
}







